#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include<QPropertyAnimation>
#include<QParallelAnimationGroup>

namespace Ui {
class widget;
}

class widget : public QWidget
{
    Q_OBJECT

public:
    explicit widget(QWidget *parent = nullptr);
    ~widget();

        // QObject interface
public:
    bool eventFilter(QObject *watched, QEvent *event) override;

private:
    QParallelAnimationGroup *sideBarAnimGrounp();

private:
    Ui::widget *ui;

    bool isSideBarIn;
    bool isCLickSideBar;

    QParallelAnimationGroup *m_sideBarAnimGrounp;
    QParallelAnimationGroup *m_mainWidgetAnim;

        //动画属性
private:
    //扩展按钮透明度变化
    Q_PROPERTY(int opacity READ opacity WRITE setOpacity)
    int m_opacity;
    int opacity()const;
    void setOpacity(int opacity);

    //输入输出框 之间的工具栏部件随扩展按钮的出现而缩小，消失而回弹
    Q_PROPERTY(int spacerLen READ spacerLen WRITE setSpacerLen)
    int m_marginLen;
    int spacerLen()const;
    void setSpacerLen(int len);

    //详细信息区域的变化
    Q_PROPERTY(QSize thisSize READ thisSize WRITE setThisSize)
    QSize m_thisSize;
    QSize thisSize()const;
    void setThisSize(const QSize& size);

    //底部控制,信息栏的区域变化
    Q_PROPERTY(int statusLen READ statusLen WRITE setStatusLen)
    int m_statusLen;
    int statusLen()const;
    void setStatusLen(const int len);

private slots:
    void showDetailWidget(bool);

};

#endif // WIDGET_H
